@use "sass:map";
@use "sass:math";
@import '../../theme/common/var.scss';
@import '../../theme/common/mixin.scss';
$typeMap: (
    primary: $--link-primary-font-color,
    danger: $--link-danger-font-color,
    success: $--link-success-font-color,
    warning: $--link-warning-font-color,
    info: $--link-info-font-color);
:host{
    display: inline-block;
}
@include b(link) {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    position: relative;
    text-decoration: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    font-size: $--link-font-size;
    font-weight: $--link-font-weight;

    @include when(underline) {
        &:hover:after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            height: 0;
            bottom: 0;
            border-bottom: 1px solid $--link-default-active-color
        }
    }

    @include when(disabled) {
        cursor: not-allowed;
    }


    &.wu-link-default  {
        color: $--link-default-font-color;
        &:hover {
            color: $--link-default-active-color
        }
        &:after {
            border-color: $--link-default-active-color
        }
        @include when(disabled) {
            color: $--link-disabled-font-color
        }
    }

    @each $type, $primaryColor in $typeMap {
        &.wu-link-#{$type} {
            color: $primaryColor;
            &:hover {
                color: mix($primaryColor, $--color-white, 80%)
            }
            &:after {
                border-color: $primaryColor
            }
            @include when(disabled) {
                color: mix($primaryColor, $--color-white, 50%)
            }
            @include when(underline) {
                &:hover:after {
                    border-color: $primaryColor
                }
            }
        }
    }

}
